#include <bits/stdc++.h>
using namespace std;
bool cal[7][1000001];
bool ipt[999999];
/*
void debug(long long int day,long long int wkday){
    for (long long int i=0;i<(day+wkday)/7+1;i++){
        for (long long int j=0;j<7;j++){
            cout<<cal[j][i];
        }
        cout<<"\n";
    }
}
*/

int main(){
    long long int wkday=0,day;
    cin>>wkday>>day;
    wkday--;
    for (long long int i = wkday; i < day+wkday; i++)
    {
        ipt[i]=1;
    }
    long long int wk=0;
    long long int n=wkday,cnt=day;
    for (long long int i = 0; i < (day+wkday)/7+1; i++)
    {
        for (long long int j = n; j < 7; j++)
        {
            if (cnt){
                cal[j][i]=1;
                cnt--;
            }
        }
        n=0;
    }
//    debug(day,wkday);
    // 计算天数答案
    long long int ans=0;
    for (long long int i=0;i<(day+wkday)/7+1;i++){
        for (long long int j=0;j<5;j++){
            ans+=cal[j][i];
        }
    }
    ans*=250;
    cout<<ans;
    return 0;
}